#include <stdio.h>
#include <string.h>

int main() {
	char str[30];
	int i = 0;
	while (scanf("%c", &str[i]) != EOF) {
		if (str[i] == 'Y') {
			break;
		}
		i++;
	}
	str[i + 1] = 0;
	//printf("%s", str);
	for (int j = 0; j < i; j++) {
		switch (str[j]) {
			case 'M':
				printf("Monday\n");
				break;
			case 'T':
				j++;
				if (str[j] == 'u') {
					printf("Tuesday\n");
				} else if (str[j] == 'h') {
					printf("Thursday\n");
				} else {
					printf("Wrong data\n");
					j--;
				}
				break;
			case 'W':
				printf("Wednesday\n");
				break;
			case 'F':
				printf("Friday\n");
				break;
			case 'S':
				j++;
				if (str[j] == 'u') {
					printf("Sunday\n");
				} else if (str[j] == 'a') {
					printf("Saturday\n");
				} else {
					printf("Wrong data\n");
					j--;
				}
				break;
			default:
				printf("Wrong data\n");
		}
	}
	return 0;
}